@import '~styles/colors.less';
@borderSize: 1px;

.root {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  border: @borderSize solid @primary;
  border-radius: 1px;
  z-index: 1;
  color: #ffffff;
}

.identifier {
  display: inline-block;
  position: absolute;
  top: -14px - @borderSize;
  left: 0 - @borderSize;
  font-size: 11px;
  line-height: 15px;
  padding: 0px 3px;
  background-color: @primary;
  border-radius: 1px 1px 0 0;

  :global {
    i, span {
      display: inline-block;
      vertical-align: top;
    }
    i {
      margin-right: 3px;
      font-size: 10px;
      line-height: 15px;
      color: #ffffff;
    }
    span {
      line-height: 15px;
      color: #ffffff;
      font-size: 10px;
      letter-spacing: 0.3px;
    }
  }
}

.inside .identifier {
  bottom: auto;
  top: 0px;
  left: 0px;
  border-radius: 0px 0px 1px 0;
}

.overed {
  border-color: @primary;
  background-color: fade(@primary, 10%);
}

.selected {
  border: 1px solid @primary;
  background-color: transparent;

  &:before {
    content: '';
    display: inline-block;
    position: absolute;
    top: 0px; right: 0px; bottom: 0px; left: 0px;
    border: 2px solid fade(@primary, 10%);
  }

  .identifier {
    background-color: @primary;
  }
}

.symbol {
  border-color: @symbolColor;
  background-color: fade(@symbolColor, 10%);

  .identifier {
    background-color: @symbolColor;
  }

  &.selected {
    border-color: @symbolColor;

    &:before {
      border: 2px solid fade(@symbolColor, 10%);
    }

    .identifier {
      background-color: @symbolColor;
    }
  }
  &.focused {
    background-color: transparent;
  }
}

.linking {
  border-color: @linkColor;
  background-color: fade(@linkColor, 10%);

  .identifier {
    background-color: @linkColor;
  }

  &.selected {
    border-color: @linkColor;
    background-color: transparent;

    &:before {
      border: 2px solid fade(@linkColor, 10%);
    }

    .identifier {
      background-color: @linkColor;
    }
  }
}

.linked {
  border-color: @linkColor;

  .identifier {
    background-color: @linkColor;
  }

  &.selected {
    border-color: @linkColor;
    background-color: transparent;

    &:before {
      border: 2px solid fade(@linkColor, 10%);
    }

    .identifier {
      background-color: @linkColor;
    }
  }
}
